#include <bits/stdc++.h>
const int MAXN = 1e5 + 10;
using namespace std;

int n, cnt, ans, temp, buc[MAXN];

map<int, int> arr;
int main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    scanf("%d", &n);
    for(int i = 1; i <= n; i++){
        scanf("%d", &temp);
        buc[temp]++;
        arr[temp] = 1;
    }
    while(true){
        cnt = 0;
        for(map<int, int>::iterator it = arr.begin(); it != arr.end(); it++){
            while(buc[it->first] == 0 && it != arr.end()) it++;
            if(it == arr.end()) break;
            buc[it->first]--, cnt++;
        }
        if(cnt >= 1) ans++;
        else break;
    }

    printf("%d", ans);
    return 0;
}

